package net.wds.study.major.service.impl;/**
 * Package: net.wds.study.major.service.impl
 * Description：
 * Author: changxiaohu
 * Date: Created in 2020/9/16 11:08
 * Company:
 * Version: 0.0.1
 */

import net.wds.study.major.dao.MajorDao;
import net.wds.study.major.entity.Major;
import net.wds.study.major.service.MajorService;
import net.wds.study.student.modal.PageModal;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.io.Serializable;

/**
 * @ClassName : MajorServiceImpl  
 * @Description : 业务接口的具体实现  
 * @Author : changxiaohu  
 * @Date: 2020-09-16 11:08  
 */
@Service("majorService")
public class MajorServiceImpl implements MajorService {

    @Autowired
    private MajorDao majorDao;

    /**
    * 方法实现说明 对专业信息进行增加操作
    * @author    cxh
    * @return
    * @exception
    * @date   2020/9/16 11:48
    */
    @Override
    public Serializable addMajor(Major major) {
        return majorDao.addMajor(major);
    }

    /**
    * 方法实现说明  对专业信息进行删除操作
    * @author    cxh
    * @return
    * @exception
    * @date   2020/9/16 11:49
    */
    @Override
    public boolean deleteMajor(Integer id) {
        return majorDao.deleteMajor(id);
    }
    /**
    * 方法实现说明 对专业信息的分页查询
    * @author    cxh
    * @return
    * @exception
    * @date   2020/9/16 11:49
    */
    @Override
    public PageModal<Major> getPageQuery(Integer startIndex, Integer pageSize, String name) {
        if(startIndex<0){
            startIndex=0;
        }
        return majorDao.getPageQuery(startIndex, pageSize, name);
    }
    /**
    * 方法实现说明  对专业信息的更新操作
    * @author    cxh
    * @return
    * @exception
    * @date   2020/9/16 11:50
    */
    @Override
    public boolean updateMajor(Major major) {
        return majorDao.updateMajor(major);
    }
}
